<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>修改密码</title>
    <link rel="stylesheet" href="./component/pear/css/pear.css" />
    <link rel="stylesheet" href="./admin/css/other/login.css" />
    <link rel="stylesheet" href="./admin/css/variables.css" />
    <script>if (window.self != window.top) { top.location.reload();}</script>
</head>

<body>
<div class="login-page" style="background-image: url(./admin/images/background.svg)">
    <div class="layui-row">
        <div class="layui-col-sm6 login-bg layui-hide-xs">
            <img class="login-bg-img" src="./admin/images/banner.png" alt="" />
        </div>
        <div class="layui-col-sm6 layui-col-xs12 login-form">
            <div class="layui-form">
                <div class="form-center">
                    <div class="form-center-box">
                        <div class="top-log-title">
                            <img class="login-bg-img" src="admin/images/logo.png" alt="" />
                        </div>
                        <div class="top-desc" style="font-size: 18px;">
                            修改密码
                        </div>
                        <div style="margin-top: 30px;">
                            <div class="layui-form-item">
                                <div class="layui-input-wrap">
                                    <div class="layui-input-prefix">
                                        <i class="layui-icon layui-icon-password"></i>
                                    </div>
                                    <input type="password" name="password" value=""
                                           lay-verify="required" placeholder="密码（6位以上，字母+数字组成）" autocomplete="off" id="password"
                                           class="layui-input" lay-affix="eye">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-wrap">
                                    <div class="layui-input-prefix">
                                        <i class="layui-icon layui-icon-password"></i>
                                    </div>
                                    <input type="password" name="password2" value=""
                                           lay-verify="required" placeholder="请再次输入密码密码" autocomplete="off" id="password2"
                                           class="layui-input" lay-affix="eye">
                                </div>
                            </div>
                            <div class="layui-form-item">
                            </div>
                            <div class="login-btn">
                                <button type="button" lay-submit lay-filter="changepswd" class="layui-btn login" style="background-color:#4e9ef3;cursor:pointer">修改密码</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<form class="layui-form" action="" lay-filter="cpForm" id="cpForm" style="display: block">
    <div style="margin-top: 15px;margin-bottom: 15px;" id="cpDiv">

    </div>
</form>

<!-- 资 源 引 入 -->
<script src="./component/layui/layui.js"></script>
<script src="./component/pear/pear.js"></script>
<script src="./common/common-config.js"></script>
<script src="./component/pear/module/extends/jsencrypt.js"></script>

<script>
    layui.use(['form', 'button', 'popup','shopx','http','pub','jquery'], function () {
        var form = layui.form;
        var shopx = layui.shopx;
        var http = layui.http;
        var pub = layui.pub;
        var $ = layui.jquery;

        // 登 录 提 交
        form.on('submit(changepswd)', function (data) {
            var model = data.field;
            if(model.password!=model.password2){
                layer.msg("两次输入的密码不一致，请重新输入");
                return false;
            }
            http.postRequest("/sysUser/changePswd",'POST',model,function suc(data) {
                location.href = "./login.html"
            });
        });
    })
</script>
</body>

</html>
